package com.nf.ch03.test06.three;

/**
 * @author lwj
 * @date 2025-03-04
 * @vesion 1.0.0
 */
public class TianShi extends Person{
    // 构造方法
    public TianShi() {}

    public TianShi(String name) {
        super(name);
    }

    /**
     * 驱妖
     * @param door 门
     */
    public void exorcise(Door door){
        // 判断门是否有辟邪的功能
        if(door instanceof TaoMuDoor){
            ((TaoMuDoor)door).flakJacket();
        }else if(door instanceof TieYuDoor){
            ((TieYuDoor)door).flakJacket();
        }else{
            System.out.println(this.getName()+"使用当前的"+door.getName()+"没有辟邪功能！");
        }
    }
}
